#pragma once

#include "w3c.h"
//#include "..\ad\ADMaterial3\http\ADCounterHook.h"
#include "SingleThread.h"
#include "AutoLock.h"
#import <msxml3.dll>
#include <string>
#include <vector>
#include <time.h>
typedef void (CALLBACK *FUN_POSTFINISH)(LPVOID pContext, const std::string &strValue);
typedef std::basic_string<TCHAR> tstring;
class CPostCount:public CSingleThread
{
public:
	CPostCount(void);
	virtual ~CPostCount(void);
	void Create();
	void AddPostCount(LPCTSTR strUrl);
	tstring GetPostCount();
	UINT __stdcall DefThreadProc();
	static void CALLBACK OnStatusChanged(HINTERNET hInternet,DWORD_PTR dwContext,DWORD dwInternetStatus,LPVOID lpvStatusInformation,DWORD dwStatusInformationLength);
private:
	std::vector<tstring> m_vUrl;
	CCritSec m_csLock;
	AsyncW3Client m_w3c;
	HANDLE m_hExit;
	std::string GetRandNumber();
};
